package com.tte.common.designpattern.command;

/**
 * @PackageName: com.tte.common.designpattern.command
 * @ClaseName: CommandPatternDemo
 * @Description: 使用 Broker 类来接受并执行命令。
 * @Author: DongWH
 * @Date: 2022/3/24 10:31
 * @params *@params $
 */
public class CommandPatternDemo {
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}

